﻿var c = new Calendar("c");
document.write(c);
c.offsetTop = 22;
c.offsetLeft = 25;

$(document).ready(function () {
    $.fn.extend({
        dropIn: function (speed, callback) {
            var $t = $(this);
            if ($t.css("display") == "none") {
                eltop = $t.css('top');
                elouterHeight = $t.outerHeight(true);
                $t.css({ top: -elouterHeight, display: 'block' })
                  .animate({ top: eltop }, speed, 'swing', callback);
            }
        }
    });
});

function x() {
    var regHtml_code = ' <form id="commentForm"><div class="field" style="padding: 5px 0;"><div><label>用户名:</label><input id="suggest2" name="name" class="required" minlength="3" /></div><div><label>邮箱:</label><input  id="cemail" name="email" class="required email" /></div><div><label>出生年月: </label><input class="required dateISO"  name="begintime" type="text" id="Text1" size="21"  onfocus="c.showMoreDay = false;c.show(this);"  value=""/></div><div id="demo2" class="demo"><br />想买房吗？</div></div></form>';
    var reg_options = {
        show: 'dropIn', buttons: { "确定注册": true, "取消注册": false },
        submit: function (v, m, f) {
            if (!v) {
                $.prompt("你取消了注册");
            }
            else {
                //form里面数据验证放这里面
            }
            return true;
        },
        callback: function (v, m, f) {
            if (v) {
                //异步提交放这里面
                $.prompt("注册成功");
            }
        }
    };

    $.prompt(regHtml_code, reg_options).children('#jqi').corner("cc:#d1c7b7");

    $(".jqi").draggable();
    $("#suggest2").focus().autocomplete(cities); //用户名
    $("#commentForm").validate(); //表单
    $("#suggest2").tooltip({ bodyHandler: function () { return "用户名必须以字母开头"; }, showURL: false });
    $("#cemail").tooltip({ bodyHandler: function () { return "建议使用新浪游戏"; }, showURL: false });
    $("#Text1").tooltip({ bodyHandler: function () { return "未成年人请不要注册"; }, showURL: false });
    $("#tooltip").corner();
    $('#demo2').rater('Handler1.ashx');
}